package com.sz.biz.common.contract.service;

import com.sz.common.base.dao.ext.IEnum;

/**
 * Package: com.sz.biz.common.contract.service<br>
 * Function:合同状态的枚举类
 * Author: yanhong.xiao.<br>
 * Date: 2017-07-21 09:23:00.
 */
public enum ContractStatusEnum implements IEnum {

    STATUS_DRAFT("1", "草稿"),

    STATUS_GENERATE("2", "已生成");

    private String code;
    private String name;

    ContractStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static ContractStatusEnum valueOfEnum(String code) {
        ContractStatusEnum[] iss = values();
        for (ContractStatusEnum cs : iss) {
            if (cs.getCode().equals(code)) {
                return cs;
            }
        }
        return null;
    }

    public static Integer getIntegerCode(ContractStatusEnum typeEnum) {
        return Integer.valueOf(typeEnum.getCode());
    }
}
